#include <STC15F2K60S2.H>
#include <stdio.h>
#include "bsp_init.h"
#include "bsp_timer.h"
#include "bsp_seg.h"
#include "bsp_led.h"

////////////////////////////
void Seg_Proc(void);
////////////////////////////

unsigned char pucSeg_Code[8],pucSeg_Buf[10],ucSeg_Pos;
unsigned long ulms;
unsigned char ucLed;
unsigned char ucSeg;



void main(void){

	Close_Peripheral();
	Timer1Init();                               
	while(1){
	
		Seg_Proc();
	}
}


void Tim1_isr() interrupt 3{

	ulms++;
	if(ulms%500 == 0){
		
		ucLed += 2;
		ucSeg++;
	}
	
	Led_Disp(ucLed);
	Seg_Disp(pucSeg_Code,ucSeg_Pos);
	if(++ucSeg_Pos == 8) ucSeg_Pos = 0;

}

void Seg_Proc(void){

	
	sprintf(pucSeg_Buf, "----%.2f",32.14);
    Seg_Tran( pucSeg_Code,pucSeg_Buf);
}







